<template>
  <view class="">
    <u-radio-group v-model="payWay">
      <view class="prow30 pt30 pb40 bg">
        <view class="flex items-center justify-between" :class="[index < payWayList.length-1? 'mb30' : '']" v-for="(item, index) in payWayList" :key="item.id">
          <view class="flex items-center">
            <!-- {{ item.imgUrl }} -->
            <image :src="item.imgUrl" class="w-48"></image>
            <text class="c333 fs30 pl16">
              {{item.name}}
            </text>
          </view>
          <u-radio active-color="#1FB0AD" :name="item.type"></u-radio>
        </view>
      </view>
    </u-radio-group>
  </view>
</template>

<script>
export default {
  name: 'Ceshi2TimeLimit',
  props: {
    // 这里可以接收父组件传过来的数据
    value: {
      type: String,
      default: 'alipay'
    },
    payWayList: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
    };
  },
  computed: {
    payWay: {
      get() {
        return this.value;
      },
      set(val) {
        this.$emit('input', val);
      }
    }
  },
  mounted() {

  },

  methods: {
    async validatePayWay() {
      let payWay = this.payWayList.find(item => item.type === this.payWay);
      if (payWay && payWay.open) {
        return true;
      } else {
        this.$u.toast('暂未开通，敬请期待！');
        return false;
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.bg {
  width: 100%;
  background-color: #fff;
  border-radius: 20rpx;
  .member_color {
    color: #EBB463;
  }
}

</style>